package router

import (
	"github.com/gin-gonic/gin"

	"mxshop-api/shared/auth"
	"mxshop-api/user-web/api"
	"mxshop-api/user-web/global"
)

func InitUserRouter(Router *gin.RouterGroup) {
	signingKey := global.ServerConfig.SigningKey
	UserRouter := Router.Group("user")
	{
		UserRouter.GET("list", auth.Middleware(signingKey), auth.IsAdminUser(), api.GetUserList)
		UserRouter.POST("pwd-login", api.PasswordLogin)
		UserRouter.POST("register", api.Register)
	}
}
